package com.itheima.ood.lambda.demo03;

public class CalculatorDemo {

    public static void main(String[] args) {

        useCalculator(new Calculator() {
            @Override
            public int sum(int a, int b) {
                return a + b;
            }
        });

        int sum = useCalculator((int a, int b) -> {

            return a + b;
        });
        System.out.println(sum);
    }

    public static int useCalculator(Calculator calculator){

        int a = 10;
        int b = 20;
        return calculator.sum(a , b);
    }
}
